using System;
using System.Collections.Generic;
using System.Text;

namespace Stratman.Utilities.NetFlix
{
    /// <summary>
    /// Exception that is thrown when an operation against a NetFlix queue (adding, removing,
    /// reordering, etc.) fails.
    /// </summary>
    public class QueueException : Exception
    {
        /// <summary>
        /// Default constructor.
        /// </summary>
        public QueueException()
            : base()
        {
        }

        /// <summary>
        /// Constructor that allows the user to pass in the return code we received back from
        /// NetFlix.
        /// </summary>
        /// <param name="resultCode">
        /// Return code that was received in response to the queue operation.
        /// </param>
        public QueueException(int resultCode)
            : base("The operation on the NetFlix queue failed with a result code of " + resultCode.ToString() + ".")
        {
        }

        /// <summary>
        /// Constructor that allows the user to pass in the return code we received back from
        /// NetFlix as well as an inner exception.
        /// </summary>
        /// <param name="resultCode">
        /// Return code that was received in response to the queue operation.
        /// </param>
        /// <param name="innerException">
        /// Inner exception for the current exception.
        /// </param>
        public QueueException(int resultCode, Exception innerException)
            : base("The operation on the NetFlix queue failed with a result code of " + resultCode.ToString() + ".", innerException)
        {
        }

        /// <summary>
        /// Constructor that allows the user to pass in a specific exception message.
        /// </summary>
        /// <param name="message">
        /// Message that should be included for the exception.
        /// </param>
        public QueueException(string message)
            : base(message)
        {
        }

        /// <summary>
        /// Constructor that allows the user to pass in a specific exception message as well as an
        /// inner exception.
        /// </summary>
        /// <param name="message">
        /// Message that should be included for the exception.
        /// </param>
        /// <param name="innerException">
        /// Inner exception for the current exception.
        /// </param>
        public QueueException(string message, Exception innerException)
            : base(message, innerException)
        {
        }
    }
}
